import { request } from "../../requests/index.js";
Page({

 
  data: {
    swiperList:[],
    catesList:[],
    floorList:[]
  },

  onLoad: function (options) {
    // wx.request({
    //   url: '/home/swiperdata',
    //   success: (result)=>{
    //     console.log(result)
    //     this.setData({
    //       swiperList:result.data.message
    //     })
    //   }
    // });
    this.getSwiperList();
    this.getCatesList();
    this.getFloorList();
  },

  // 获取轮播图数据
  getSwiperList(){
    request({url: '/home/swiperdata'})
    .then(result => {
      this.setData({
              swiperList:result
            })
    })
  },

  // 获取分类导航
  getCatesList(){
    request({url:"/home/catitems"})
    .then(result =>{
      this.setData({
        catesList:result
      })
    })
  },
  // 获取楼层
getFloorList(){
  request({url:"/home/floordata"})
    .then(result =>{
      this.setData({
        floorList:result
      })
    })
}


  
})